For whatever reason, Apple doesn’t really document it anywhere outside a lone support article. This allows any macOS user to conveniently run speed tests right in the comfort of their Terminal by executing the following command:
LAN Speed Test was designed from the ground up to be a simple but powerful tool for measuring file transfer, hard drive, USB Drive, and Local Area Network (LAN) speeds (wired & wireless).